#/usr/bin/env bash

_lcli_completions()
{
    if [ "${#COMP_WORDS[@]}" != "2" ]; then
	return
    fi
    COMPREPLY=()
    cur=${COMP_WORDS[COMP_CWORD]}
    case "$cur" in
	-*)
	    COMPREPLY=( $( compgen -W '--list-commands' -- $cur )) ;;
	*)
	    COMPREPLY+=($(compgen -W "$(lcli --list-commands | awk '{ print $1; } ')" "${COMP_WORDS[1]}")) ;;
    esac
}

complete -F _lcli_completions lcli
